function validInput(string)
{
    regex1 = /[<>].*/;
    return regex1.test(string);
}
function hasWhiteSpace(s) 
{
     reWhiteSpace = new RegExp(/^\s+$/);

     // Check for white space
     if (reWhiteSpace.test(s)) {
          //alert("Please Check Your Fields For Spaces");
          return false;
     }
return true;
}
function validateemail(frm_id,email) 
{
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[frm_id].elements[email].value;
  return reg.test(address);
}

function check_input(fieldId,errId,isnum)
{
	var success=false;
	var fval = $("#"+fieldId).val();
	var fieldName=$("#"+fieldId).attr("rel");
	var errmsg=fieldName;
	if(validInput(fval))
	{
		$('#'+errId).text(errmsg).show();
		$('#'+fieldId).focus();
		success=false;
	}else
	{
		if(isnum=="yes"){
			if(fval!='' && isNaN(parseInt(fval,10)) )
			{
			  $('#'+errId).text(errmsg).show();
			  $('#'+fieldId).focus();
			  success=false;
			}else{
				$('#'+errId).text('');
				success=true;
			}
		}  
		$('#'+errId).text("");
		success=true;
	}
	return success;

}


function getTimeFormat()
{
	var months = new Array(12);
	 months[0] = "January";
	 months[1] = "February";
	 months[2] = "March";
	 months[3] = "April";
	 months[4] = "May";
	 months[5] = "June";
	 months[6] = "July";
	 months[7] = "August";
	 months[8] = "September";
	 months[9] = "October";
	 months[10] = "November";
	 months[11] = "December";
	 var dt=new Date();
	 var hour        = dt.getHours();
	 var minute      = dt.getMinutes();
	 var second      = dt.getSeconds();
	 var monthnumber = dt.getMonth();
	 var monthday    = dt.getDate();
	 var year        = dt.getFullYear();
	 var ap="";
	 var hr="";
	 if(hour>=12)
	 {
		 ap="PM";
		 hr=hour-12;
	 }
	 if(hour<12){
		 ap="AM";
	 }
	 
	 dtime= hr+":"+minute+" "+ap+" "+months[monthnumber]+" "+monthday+", "+year;
	 return dtime;
             
}	
	